<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <title>酒店管理系统</title>
    <link rel="shortcut icon" href="favicon.ico">
	<link rel="stylesheet" href="../static/css/superfish.css">
	<link rel="stylesheet" href="../static/css/bootstrap-datepicker.min.css">
	<link rel="stylesheet" href="../static/css/cs-select.css">
	<link rel="stylesheet" href="../static/css/cs-skin-border.css">

	<link rel="stylesheet" href="../static/css/themify-icons.css">
	<link rel="stylesheet" href="../static/css/flaticon.css">
	<link rel="stylesheet" href="../static/css/icomoon.css">
	<link rel="stylesheet" href="../static/css/flexslider.css">
    <link rel="stylesheet" href="../static/my.css">
</head>
<body>
<div style="background-color: #dddddd">

<nav id="fh5co-menu-wrap" role="navigation">

						<ul class="sf-menu" id="fh5co-primary-menu">
                            <li><h2 style="color:#ffffff;float: left;padding-top: 8px">酒店管理系统&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</h2></li>
							<li><a href="http://127.0.0.1:8000/index">员工管理</a></li>
							<li><a href="http://127.0.0.1:8000/insert_client" >顾客管理</a></li>
							<li><a href="http://127.0.0.1:8000/insert_food">餐厅管理</a></li>
                            <li><a href="http://127.0.0.1:8000/insert_room">客房管理</a></li>
							<li><a href="http://127.0.0.1:8000/insert_park">停车场管理</a></li>
                            <li><a href="http://127.0.0.1:8000/insert_vip">会员信息管理</a></li>
                            <li><a href="http://127.0.0.1:8000/insert_order">餐厅订单管理</a></li>
                            <li><a href="http://127.0.0.1:8000/insert_accomodation">客房订单管理</a></li>
                           {% comment %} <li><a href="#">个人中心</a></li>{% endcomment %}
						</ul>

					</nav>
<br>
<br>
<br>
<div style="width: 70%;margin-left: 15%;background-color: #ffffff">
<center>
    <!--<a href="http://127.0.0.1:8000/insert">-->
    <div class="logo">
					<h2>员工信息录入</h2>
    </div></center>

<form action="/insert/" method="post" style="margin-left:40px">

     <p><label >工号&nbsp;:&nbsp;&nbsp;</label><input type="text" name="id" style="width: 500px;height: 25px"/></p>
     <p><label >姓名&nbsp;:&nbsp;&nbsp;</label><input type="text" name="name" style="width: 500px;height: 25px"/></p>
     <!--<i>职务</i><input type="text" name="job"/><br>-->

     <p><label>职务&nbsp;:&nbsp;&nbsp;</label>&nbsp<select name="job">
        <option value="总经理">总经理</option>
        <option value="大堂经理">大堂经理</option>
        <option value="厨师">厨师</option>
        <option value="服务员">服务员</option>
        <option value="保安">保安</option>
     </select></p>
     <p><label>月薪&nbsp;:&nbsp;&nbsp;</label><input type="text" name="salary" style="width: 500px;height: 25px"/></p>
     <p><label>工龄&nbsp;:&nbsp;&nbsp;</label><input type="text" name="time_work" style="width: 500px;height: 25px"/></p>
        <p><input type="submit" value="提交"></p><br/><br/><br/>

</form>
</div>
<p>&nbsp;</p><p>&nbsp;</p>
<div style="width: 70%;margin-left: 15%;background-color: #ffffff;height: 500px">
<a href="http://127.0.0.1:8000/index">
    <center>
    <div class="logo">
					<h2>员工信息展示</h2>
    </div>
    </center>
</a>
<center>
    <table border="1" cellspacing="0" style="width: 90%">
    <tr>
        <th>工号</th>
        <th>姓名</th>
        <th>职务</th>
        <th>月薪/元</th>
        <th>工龄/年</th>
        <th colspan="2">操作</th>
    </tr>
    {% for line in people_list %}
    <tr>
        <td class="id">{{line.员工id}}</td>
        <td>{{line.姓名}}</td>
        <td>{{line.职务}}</td>
        <td>{{line.月薪 }}</td>
        <td>{{line.工龄 }}</td>
        <td><center><button class="btn btn-primary delete">删除</button></center></td>
        <td><center><button class="btn btn-primary update">修改</button></center></td>
    </tr>
    {% endfor %}
    </table>
</center>
</div>
<p>&nbsp;</p><p>&nbsp;</p>

<!--
<center>
	<h2><a>员工信息查询</a></h2>
			</div>


                <form action="/single/" method="post">
        <p>根据员工编号查询员工信息</p>
                    <input type="text"  name="id">
                    <input type="submit">
                </form>
        <table>
        <tbody>
        <tr>
            {% for line in  rlt %}
             <td>
                 <a href="{{ line.url}}" target="_blank"><img src="{{ line.image}}" width="160" height="220" /></a><p></p>编号：{{line.员工id}}<br>姓名：{{line.姓名}}<br>职务：{{ line.职务 }}<br>月薪：{{ line.月薪 }}<br>工龄：{{ line.工龄 }}
             </td>
            {% endfor %}
        </tr>
        </tbody>
    </table>
</center>
-->
<div style="width: 70%;margin-left: 15%;background-color: #ffffff;height: 500px">
    <center>
        <h2><a>员工信息查询</a></h2>
                    <form action="/search_staff/" method="post">
            <p>根据选择的属性查询员工信息</p>
                        <i></i>&nbsp<select name="columns">
                            <option value="员工id">工号</option>
                            <option value="姓名">姓名</option>
                            <option value="职务">职务</option>
                            <option value="月薪">月薪</option>
                            <option value="工龄">工龄</option>
                                              </select>
                        <input type="text" name="value">
                        <input type="submit">
                    </form>
            <table >
            <tbody>
            <tr>
                {% for line in  staffs %}
                 <td style="display: inline-block">
                     <a href="{{ line.url}}" target="_blank"><img src="/static/images/t1.jpg" width="160" height="220" /></a><p></p>编号：{{line.员工id}}<br>姓名：{{line.姓名}}<br>职务：{{ line.职务 }}<br>月薪：{{ line.月薪 }}<br>工龄：{{ line.工龄 }}
                 </td>
                {% endfor %}
            </tr>
            </tbody>
        </table>
    </center>
</div>
<br>
<br>
</body>
<script src="../static/js/jquery-2.1.4.min.js"></script>
<script>
    $(".delete").click(function () {
        $(this).parent().parent().remove();
        var id = $(this).parent().siblings(".id").first().html();
        <!--alert(id);-->
        $.get('../delete_staff',{'id': id});
    });
</script>
<script>
    $(".update").click(function () {
        var ID = $(this).parent().siblings(".id").first();
        if ($(this).text() == "修改") {
            $(this).text("完成");
            ID.next().next().html('<input type=\"text\" class=\"job\"/>');
            ID.next().next().next().html('<input type=\"text\" class=\"salary\"/>');
            ID.next().next().next().next().html('<input type=\"text\" class=\"time\"/>');
        }
        else{
            var id = ID.html();
            var job = ID.next().next().children().val();
            var salary = ID.next().next().next().children().val();
            var time = ID.next().next().next().next().children().val();
            var staff = {'id':id, 'job':job, 'salary': salary, 'time':time};
            $.post('../update_staff/',staff, function(res){
                location.reload();
            });
        }
    });
</script>
</html>